package action.member;

import org.apache.struts2.ServletActionContext;

import security.MySecurityContextHandle;
import service.interf.IDeviceLog;
import action.common.MyBaseAction;

import com.opensymphony.xwork2.ModelDriven;

import dao.pojo.DeviceLog;

public class DeviceLogBrowAction extends MyBaseAction<DeviceLog> implements
		ModelDriven<DeviceLog> {

	private static final long serialVersionUID = 1L;
	private IDeviceLog iDeviceLog;

	public void setiDeviceLog(IDeviceLog iDeviceLog) {
		this.iDeviceLog = iDeviceLog;
	}

	public DeviceLogBrowAction() {
		super(DeviceLog.class);
	}

	public DeviceLog getModel() {
		return model;
	}

	/**
	 * 获取列表
	 */
	public void getlist() {
		String r = "1";
		try {
			Long userId = MySecurityContextHandle.getUserId();
			r = iDeviceLog.getList(userId, model.getPage(), model.getRows());
		} catch (Exception e) {
			r = errorHandle.handleErr(e);
		}
		servletHandle.writeToClient1(ServletActionContext.getResponse(), r);
	}

}
